Skip to content

refactor(core): remove l2 feature from cmd/ethrex achieving a single binary for both L1 and L2 #3381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Jul 4, 2025

Conversation

ilitteri
Copy link
Contributor

Warning

Merge after #3371

Motivation

We want ethrex to be a single binary for both running L1 and L2. For this, we need to remove the l2 feature flag from cmd/ethrex, a work that includes removing the same feature flag from the following crates:

  1. ethrex-vm.
  2. ethrex-levm.
  3. ethrex-blockchain.

1 and 2 are removed in #3367, and 3 is removed in #3371.

Description

Removes l2 feature flag from cmd/ethrex

Copy link

github-actions bot commented Jun 27, 2025

Lines of code report

Total lines added: 0
Total lines removed: 6
Total lines changed: 6

Detailed view
+----------------------------+-------+------+
| File                       | Lines | Diff |
+----------------------------+-------+------+
| ethrex/cmd/ethrex/cli.rs   | 451   | -3   |
+----------------------------+-------+------+
| ethrex/cmd/ethrex/lib.rs   | 8     | -1   |
+----------------------------+-------+------+
| ethrex/cmd/ethrex/utils.rs | 143   | -2   |
+----------------------------+-------+------+

Copy link
Collaborator

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ilitteri ilitteri requested review from juanbono, jrchatruc and a team June 30, 2025 19:58
…ambdaclass/ethrex into remove_l2_feature_from_cmd_ethrex
@MegaRedHand MegaRedHand moved this from In Review to Queued in ethrex_l2 Jul 2, 2025
Base automatically changed from remove_l2_feature_flag_from_blockchain to main July 2, 2025 18:06
@MegaRedHand MegaRedHand enabled auto-merge July 2, 2025 18:44
@MegaRedHand MegaRedHand added this pull request to the merge queue Jul 4, 2025
Merged via the queue into main with commit 94d465e Jul 4, 2025
37 checks passed
@MegaRedHand MegaRedHand deleted the remove_l2_feature_from_cmd_ethrex branch July 4, 2025 02:13
@github-project-automation github-project-automation bot moved this from Queued to Done in ethrex_l2 Jul 4, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 4, 2025
**Motivation**

Create an ethrex release when a semver tag is pushed to the repo

**Description**

- Modifies already existing L2 releases workflow to build 
- For `ethrex client` (right now only for L2 but can be used for both L1
and L2 after #3381 is merged )
     - Build for `linux-x86_64` , `linux-arm64`, `macos-arm64`
  - For `ethrex prover client`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
 - For `ethrex replay`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
  - Creates a release with
- Changelog from all the changes between the previous tag and the newly
created one.
- All the built binaries and the rollup L1 and L2 contracts in a tar
archive
- Example from testing repo
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.1 before
adding the contracts to the release output
- Another example with the contracts
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.2
- Example of all outputs
https://github.com/lambdaclass/ethrex/actions/runs/16077779945
- Non related change: pin the version for the docker image in sp1 
- With #3381 merged we now build ethrex with --all-features so the
default database was changed to libmdbx when initializing the store.
**Other considerations**

> Q: No sp1 cpu?
> A: Right now it's too slow to be viable in production environments

> Q: No sp1 macos?
> A: sp1 does not support the metal api for gpu acceleration. Also
because zkvms are built using docker we'll run into a problem where the
macos github runner does not have docker installed.
> After a quick investigation into this issue we have to use
[colima](actions/runner#1456 (comment))
for docker.
> This leads into another issue where sp1 uses a docker image built only
for amd64 this requires nested virtualization support that is enabled in
apple M3 chips or later but [the runner is currently using M1
chips](https://docs.github.com/en/actions/concepts/runners/about-larger-runners#limitations-for-macos-larger-runners).

> Q: Why does building the sp1 prover for
[arm-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455867)
take twice as long as building for
[x86-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455854)
> A: We have to use QEMU inside the `arm-64` runner because the sp1
docker image is only built for `amd64`

> Q: wen risc0
> A: ~After #3172 is merged~
[Now](https://github.com/lambdaclass/ethrex/actions/runs/16036016678/job/45247866997)
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
…e binary for both L1 and L2 (lambdaclass#3381)

> [!WARNING]
> Merge after lambdaclass#3371

**Motivation**

We want `ethrex` to be a single binary for both running L1 and L2. For
this, we need to remove the `l2` feature flag from `cmd/ethrex`, a work
that includes removing the same feature flag from the following crates:

1. `ethrex-vm`.
2. `ethrex-levm`.
3. `ethrex-blockchain`. 

1 and 2 are removed in lambdaclass#3367,
and 3 is removed in lambdaclass#3371.

**Description**

Removes `l2` feature flag from `cmd/ethrex`
d-roak pushed a commit to 1sixtech/ethrex that referenced this pull request Jul 17, 2025
**Motivation**

Create an ethrex release when a semver tag is pushed to the repo

**Description**

- Modifies already existing L2 releases workflow to build 
- For `ethrex client` (right now only for L2 but can be used for both L1
and L2 after lambdaclass#3381 is merged )
     - Build for `linux-x86_64` , `linux-arm64`, `macos-arm64`
  - For `ethrex prover client`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
 - For `ethrex replay`
    - For `exec` mode
       - Build for `linux-x86_64` `linux-arm64` and `macos-arm64`
     - For `sp1 gpu` mode 
         - Build for `linux-x86_64` `linux-arm64`
     - For `risc0 gpu` mode
        - Build for `linux-x86_64`
  - Creates a release with
- Changelog from all the changes between the previous tag and the newly
created one.
- All the built binaries and the rollup L1 and L2 contracts in a tar
archive
- Example from testing repo
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.1 before
adding the contracts to the release output
- Another example with the contracts
https://github.com/LeanSerra/ethrex/releases/tag/v0.0.7-rc.2
- Example of all outputs
https://github.com/lambdaclass/ethrex/actions/runs/16077779945
- Non related change: pin the version for the docker image in sp1 
- With lambdaclass#3381 merged we now build ethrex with --all-features so the
default database was changed to libmdbx when initializing the store.
**Other considerations**

> Q: No sp1 cpu?
> A: Right now it's too slow to be viable in production environments

> Q: No sp1 macos?
> A: sp1 does not support the metal api for gpu acceleration. Also
because zkvms are built using docker we'll run into a problem where the
macos github runner does not have docker installed.
> After a quick investigation into this issue we have to use
[colima](actions/runner#1456 (comment))
for docker.
> This leads into another issue where sp1 uses a docker image built only
for amd64 this requires nested virtualization support that is enabled in
apple M3 chips or later but [the runner is currently using M1
chips](https://docs.github.com/en/actions/concepts/runners/about-larger-runners#limitations-for-macos-larger-runners).

> Q: Why does building the sp1 prover for
[arm-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455867)
take twice as long as building for
[x86-64](https://github.com/LeanSerra/ethrex/actions/runs/16010958409/job/45168455854)
> A: We have to use QEMU inside the `arm-64` runner because the sp1
docker image is only built for `amd64`

> Q: wen risc0
> A: ~After lambdaclass#3172 is merged~
[Now](https://github.com/lambdaclass/ethrex/actions/runs/16036016678/job/45247866997)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line interface L1 Ethereum client L2 Rollup client simplification Any refactor that makes code simpler and more straight forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants